package com.tqw.client.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * MP相关配置
 * @author Will
 */
@Component
public class MybatisPlusConfig {
    /**
     * 定义MP使用Mariadb数据库
     * @return
     */
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor
                (new PaginationInnerInterceptor(DbType.MARIADB));
        return interceptor;
    }
}
